using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BaseMono : MonoBehaviour
{
    public GameObject FindNode(GameObject root, string name)
    {
        foreach (Transform item in root.transform)
        {
            if (item.name.Equals(name))
            {
                return item.gameObject;
            }
            else
            {
                GameObject obj = FindNode(item.gameObject, name);
                if (obj != null)
                {
                    return obj.gameObject;
                }
            }
        }
        return null;
    }
}
